package us.norepeter.processing.textmatcher;

public class TextProcessingChainLink {

	public static final int NO_MATCH = 12345678;
	
	/**
	 * Processes this link, returns true if the comparison can be eliminated.
	 * @param e1
	 * @param e2
	 * @return
	 */
	public boolean process( Comparison c ) {
		if( this instanceof FilterChain ) {
			FilterChain chain = (FilterChain) this;
			int score = chain.getScore(c.getE1(), c.getE2());
			c.addToScore( score );
			return chain.doesNotMeetThreshold(score);
		}
		if( this instanceof Transformer ) {
			((Transformer) this).transform(c.getE1());
			((Transformer) this).transform(c.getE2());
		}
		return false;
	}
}
